/*
 * LogisticsListItem.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.content.Context;
import android.support.v4.util.ArrayMap;

import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.LogisticsHolder;

/**
 * 物流信息
 */
public class LogisticsListItem extends DisplayListItem<LogisticsHolder, ArrayMap<String, String>> {

    public LogisticsListItem(ArrayMap<String, String> s) {
        super(s);
    }

    @Override
    public void onShow(Context context, LogisticsHolder holder) {
        holder.itemLogistics.setTime(data.get("time"));
        holder.itemLogistics.setTitle(data.get("info"));

        /*  if (data.get("isFirst").equals("1") && data.get("isLast").equals("1")) {
            holder.itemLogistics.setOneItem();
        } else if (data.get("isLast").equals("1")) {
            holder.itemLogistics.setLastItem();
        }*/
        if (data.get("isFirst").equals("1")) {
            holder.itemLogistics.setFirstItem();
        } else {
            holder.itemLogistics.setNormal();
        }
    }

    @Override
    public String getDisplayItemTag() {
        return LogisticsListItem.class.getSimpleName();
    }

    @Override
    public Class<LogisticsHolder> getViewHolderClazz() {
        return LogisticsHolder.class;
    }
}
